module.exports = React.createClass
	getInitialState: ->
		username: '',
		lastGistUrl: ''
		
	componentDidMount: ->
		com = this;
		$.get this.props.source, ((result) ->
			lastGist = result[0];
			console.log result[0]
			console.log lastGist.owner.login
			console.log lastGist.html_url
			if this.isMounted
				this.setState
					username: lastGist.owner.login,
					lastGistUrl: lastGist.html_url
			).bind(this)
	render: ->
		<div>
			{this.state.username}'s last gist is
			<a href={this.state.lastGistUrl}> here </a>
		</div>